<?php


namespace app\common\model;


use think\Model;

class ShopSuborderModel extends Model
{
    public function goods(){
        return $this->hasMany(ShopOrderGoodsModel::class,'suborderid','id')->with('goods');
    }
    public function shop(){
        return $this->hasOne(UserModel::class,'id','shopid')->field('id,avatar,nick_name');
    }
    public function user(){
        return $this->hasOne(UserModel::class,'id','uid')->field('id,avatar,nick_name');
    }
    public function parent(){
        return $this->hasOne(ShopOrderModel::class,'id','parentid');
    }
}